import request from '@/utils/request'

const api_name = '/edu/video'

export default {
  // 根据章节id删除课时
  removeById(id) {
    return request({
      url: `${api_name}/${id}`,
      method: 'delete'
    })
  },

  // 新增课时
  saveVideoInfo(videoInfo) {
    return request({
      url: `${api_name}/save-video-info`,
      method: `post`,
      data: videoInfo
    })
  },

  // 根据章节id查询课时
  getVideoInfoById(id) {
    return request({
      url: `${api_name}/video-info/${id}`,
      method: 'get'
    })
  },

  // 根据章节id修改课时
  updateVideoInfoById(videoInfo) {
    return request({
      url: `${api_name}/update-video-info/${videoInfo.id}`,
      method: 'put',
      data: videoInfo
    })
  }

}
